package com.newcoder.community.dao;

import com.newcoder.community.pojo.DiscussPost;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.lang.Nullable;
import org.springframework.stereotype.Repository;

import java.util.List;
@Mapper
@Repository
public interface DisCussPostMapper {

    //测试
    List<DiscussPost> queryAll();
    //分页
    List<DiscussPost> selectDiscussPosts(int userId, @Nullable int offset,@Nullable int limit);
   //查询总行数
    int  selectDiscussPostRows(@Param("userId") int userId);

    int insertDiscussPost(DiscussPost discussPost);

    DiscussPost queryById(int id);
    int updateCommentCount(int id,int commentCount);

}
